﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace TwitterLib
{
    [Serializable]
    public class Emotion : INotifyPropertyChanged, TwitterLib.IEmotion
    {
        private string phrase;
        private string type;
        private string url;
        private bool isHot;
        private int orderNumber;
        private string category;
        private bool isCommon;

        public string Phrase
        {
            get { return phrase; }
            set
            {
                if (value != phrase)
                {
                    phrase = value;
                    OnPropertyChanged("Phrase");
                }
            }
        }
        public string Type
        {
            get { return type; }
            set
            {
                if (value != type)
                {
                    type = value;
                    OnPropertyChanged("Type");
                }
            }
        }
        public string Url
        {
            get { return url; }
            set
            {
                if (value != url)
                {
                    url = value;
                    OnPropertyChanged("Url");
                }
            }
        }
        public bool IsHot
        {
            get { return isHot; }
            set
            {
                if (value != isHot)
                {
                    isHot = value;
                    OnPropertyChanged("IsHot");
                }
            }
        }
        public int OrderNumber
        {
            get { return orderNumber; }
            set
            {
                if (value != orderNumber)
                {
                    orderNumber = value;
                    OnPropertyChanged("OrderNumber");
                }
            }
        }

        public string Category
        {
            get { return category; }
            set
            {
                if (value != category)
                {
                    category = value;
                    OnPropertyChanged("Category");
                }
            }
        }

        public bool IsCommon
        {
            get { return isCommon; }
            set
            {
                if (value != isCommon)
                {
                    isCommon = value;
                    OnPropertyChanged("IsCommon");
                }
            }
        }
        #region INotifyPropertyChanged Members

        /// <summary>
        /// INotifyPropertyChanged requires a property called PropertyChanged.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Fires the event for the property when it changes.
        /// </summary>
        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

    }

    [Serializable]
    public class EmotionCollection : ObservableCollection<Emotion>
    {
    }
}
